<?php
/*
Template Name: Category Landing Page
*/
?>

<?php
	global $landingpagefeaturedproductsku, $landingpagetopcontent;
	$landingpagefeaturedproductsku = get_post_meta($post->ID, 'landingpagefeaturedproductsku', true);
?>

<?php get_header(); ?>
<?php global $woo_options; ?>

<style>
    p.stock { display:none; }
</style>
       
    <div id="content" class="page col-full">
		<div id="main" class="col-left">
		           
		<?php if ( $woo_options[ 'woo_breadcrumbs_show' ] == 'true' ) { ?>
			<?php woo_breadcrumbs(); ?>  
		<?php } ?>  			

        <?php if (have_posts()) : $count = 0; ?>
        <?php while (have_posts()) : the_post(); $count++; ?>
                                                                    
            <div <?php post_class(); ?>>

			    <h1 class="title"><?php the_title(); ?></h1>
                            <?php include '/home/silicons/public_html/wp-content/themes/woostore/page-include-social-block.php'; ?>

                <div class="entry">
                    
                    <?php // Include Top Customizations
                        if(is_page(22945)) {
                            include '/home/silicons/public_html/wp-content/themes/woostore/page-include-custom-22945.php';
                    } ?>
                    
                    <?php if(get_field('mainfeaturedproduct')) {
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-old-cat-featured-three.php';
                    } else { ?>
                
                	<div style="width:50%;float:left;margin:0px;font-size:14px;" class="catlandingtext">
                	<style>
						.catlandingtext .yarpp-related { display:none; }
						.catlandingtext p, .catlandingtext ul li { font-size:14px;line-height:18px; }
					</style>
                	<?php the_field('landingpagetoptext'); ?>
                </div>
                
                <div style="width:45%;float:right;margin:0px;border:#cccccc 1px solid;padding:10px;">
                    <div style="text-align:center;">
                    	<?php include 'page-include-category-landing-page-featured-product.php'; ?>
                    </div>
                </div>
                    
                    <?php } ?>
                
                <div style="width:685px;height:0px;clear:both;margin-bottom:10px;"></div>
                
                    <?php if(get_field('ppcompareproductone') != '') { // Include The Comparison Module
                        echo '<h2 class="pagesubsectionheader">Check Out Our Most Popular Products</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-pagepost-comparison-products.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(26539)) { // Flexible Solar Panels Old Cat Page - 12V Section
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = 'Volts';
                        $productattributetwo = 'Watts';
                        $categorylist = array(888,889,890);
                        echo '<h2 class="pagesubsectionheader">12-15V Consumer-Ready Flexible Solar Panels</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-panels-plist-layout.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(17148)) { // Educational Solar Kits
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = 'Tech';
                        $productattributetwo = 'Grades';
                        $categorylist = array(847,846,845,1184);
                        echo '<h2 class="pagesubsectionheader">Educational Solar Kits</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-edukits-plist-layout.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(17030)) { // Cabin Solar Kits
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = 'Watts';
                        $productattributetwo = 'AC / DC';
                        $productcategoryslugs = array('cabin-solar-kits');
                        echo '<h2 class="pagesubsectionheader">Cabin Solar Kits</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-cabin-kits-plist-layout-byslug.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(27312)) { // RV Solar Kits
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = 'Watts';
                        $productattributetwo = 'AC / DC';
                        $productcategoryslugs = array('rv-solar-kits');
                        echo '<h2 class="pagesubsectionheader">RV Solar Kits</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-rv-kits-plist-layout-byslug.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(17162)) { // Evaucated Tube Collectors
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = '# Tubes';
                        $productattributetwo = 'Type';
                        $categorylist = array(764,765,768);
                        echo '<h2 class="pagesubsectionheader">Evacuated Tube Solar Collectors</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-evac-tubes-plist-layout-byslug.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(26539)) { // Flexible Solar Panels Old Cat Page - 3-12V Section
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = 'Volts';
                        $productattributetwo = 'Amps';
                        $categorylist = array(888,889,890);
                        echo '<h2 class="pagesubsectionheader">3-15V Flexible Solar Panels</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-panels-plist-layout.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(27311)) { // Flexible Solar Panels Old Cat Page - 3-4V Section
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = 'Volts';
                        $productattributetwo = 'Amps';
                        $productcategoryslugs = array('3v-4v-flexible-solar-panels');
                        echo '<h2 class="pagesubsectionheader">3-4V Flexible Solar Panels</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-panels-plist-layout-byslug.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(27318)) { // Flexible Solar Panels Old Cat Page - 6-7V Section
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = 'Volts';
                        $productattributetwo = 'Amps';
                        $productcategoryslugs = array('6v-7v-flexible-solar-panels');
                        echo '<h2 class="pagesubsectionheader">6-7V Flexible Solar Panels</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-panels-plist-layout-byslug.php';
                    } ?>
                
                    <?php // Add The Custom Product Layout
                        if(is_page(17142) || is_page(17104)) { // Commercial Solar Cells & Photovoltaic Solar Cells Old Cat Pages
                        global $categorylist, $productattributeone, $productattributetwo;
                        $productattributeone = 'Watts';
                        $productattributetwo = 'Amps';
                        $productcategoryslugs = array('commercial-solar-cells');
                        echo '<h2 class="pagesubsectionheader">Commercial Solar Cells</h2>';
                        include '/home/silicons/public_html/wp-content/themes/woostore/page-include-cells-plist-layout-byslug.php';
                    } ?>
                
                        <?php if(get_field('landingpagetoptext')) { ?>
                            <h2 class="pagesubsectionheader">About <?php the_title(); ?></h2>
                            <?php the_field('landingpagetoptext'); ?>
                        <?php } ?>
                
                	<?php the_content(); ?>
                
                        <?php // Include The Contact Block - If Option Is Turned On - Matt B - Apr 2013
                            if (get_field('showcontactblock')) {
                                echo do_shortcode('[contact]');
                        } ?>
                    
                    <div style="width:100%;height:20px;margin:0px;clear:both;"></div>
                
                <?php include 'custom-function-children-of-current-page.php' ; ?>
                    
                    <?php include 'page-include-why-shop-block.php'; ?>

					<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'woothemes' ), 'after' => '</div>' ) ); ?>
               	</div><!-- /.entry -->

				<?php edit_post_link( __( '{ Edit }', 'woothemes' ), '<span class="small">', '</span>' ); ?>
                
            </div><!-- /.post -->
            
            <?php $comm = $woo_options[ 'woo_comments' ]; if ( ($comm == "page" || $comm == "both") ) : ?>
                <?php comments_template(); ?>
            <?php endif; ?>
                                                
		<?php endwhile; else: ?>
			<div <?php post_class(); ?>>
            	<p><?php _e( 'Sorry, no posts matched your criteria.', 'woothemes' ) ?></p>
            </div><!-- /.post -->
        <?php endif; ?>  
        
		</div><!-- /#main -->

        <?php get_sidebar(); ?>

    </div><!-- /#content -->
		
<?php get_footer(); ?>